package com.iphanta.community.following.web;

import com.iphanta.community.common.entity.DataResult;
import com.iphanta.community.common.utils.ResultUtils;
import com.iphanta.community.following.service.HandPickedService;
import com.iphanta.community.following.traffic.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 精选
 *
 * @author 墨声 E-mail: zehong.hongframe.huang@gmail.com
 * create time: 3/8/22 6:39 PM
 */
@RestController
@RequestMapping("community/dynamic/handpicked/")
public class HandPickedController {

    @Autowired
    private HandPickedService handPickedService;

    /**
     * 挑选为精选
     *
     * @param request
     * @return
     */
    @PostMapping("selected")
    public DataResult<HandPickedResponse> selected(@RequestBody HandPickedRequest request) {
        return ResultUtils.SUCCESS.result(this.handPickedService.selected(request));
    }

    /**
     * 精选列表
     *
     * @param request
     * @return
     */
    @PostMapping("list")
    public DataResult<HandPickedListResponse> list(@RequestBody HandPickedListRequest request) {
        return ResultUtils.SUCCESS.result(this.handPickedService.list(request));
    }

    /**
     * 标签列
     *
     * @return
     */
    @PostMapping("tags")
    public DataResult<HandPickedTagsResponse> tags() {
        return ResultUtils.SUCCESS.result(this.handPickedService.tags());
    }

}
